package NetWork;

import java.io.IOException;
import java.net.SocketException;
import java.util.HashMap;
import java.util.Map;

public class UdpDict extends UdpServer {

    private Map<String,String> map = new HashMap<>();
    public UdpDict(int port) throws SocketException {
        super(port);
        map.put("cat","小猫");
        map.put("dog","小狗");
        map.put("animal","动物");

    }

    @Override
    public String coclulate(String s1){
      return map.getOrDefault(s1,"啥也不是");
    }

    public static void main(String[] args) throws IOException {
        UdpDict udpDict = new UdpDict(9090);
        udpDict.start();
    }
}
